/* AdminPostManagement.css - 管理员帖子管理页面样式 */

.admin-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-xl);
    max-width: 1400px;
    margin: 0 auto;
    min-height: 600px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
}

.admin-title h1 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
}

.admin-title p {
    color: var(--text-gray-light);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-purple);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover:not(:disabled) {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 统计信息 */
.posts-stats {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stat-label {
    color: var(--text-gray-light);
    font-weight: 500;
}

.stat-value {
    color: var(--text-white);
    font-weight: bold;
    font-size: 1.1rem;
}

/* 表格容器 */
.posts-table-container {
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    overflow: hidden;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table thead {
    background: var(--bg-glass);
}

.posts-table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-white);
    border-bottom: 1px solid var(--border-glass);
}

.posts-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-gray-light);
    vertical-align: top;
}

.posts-table tbody tr {
    transition: all 0.3s ease;
}

.posts-table tbody tr:hover {
    background: var(--bg-glass);
}

.posts-table tbody tr.sticky-post {
    background: rgba(124, 58, 237, 0.1);
    border-left: 3px solid var(--primary-purple);
}

/* 帖子标题单元格 */
.post-title-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
}

.post-title {
    color: var(--text-white);
    font-weight: 500;
    display: block;
}

.post-content {
    color: var(--text-gray-light);
    font-size: 0.875rem;
    display: block;
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.sticky {
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-purple);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.status-badge.normal {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-gray-light);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.action-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sticky-btn {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.sticky-btn:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.3);
}

.unsticky-btn {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.unsticky-btn:hover:not(:disabled) {
    background: rgba(251, 191, 36, 0.3);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.delete-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
}

/* 空状态 */
.no-posts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-gray-light);
    gap: var(--spacing-md);
}

.no-posts span {
    font-size: 3rem;
}

.no-posts p {
    font-size: 1.1rem;
}

/* 确认对话框 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirm-dialog {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    animation: dialogSlideIn 0.3s ease;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-header {
    padding: var(--spacing-lg) var(--spacing-lg) 0;
}

.confirm-header h3 {
    color: var(--text-white);
    margin: 0;
    font-size: 1.25rem;
}

.confirm-content {
    padding: var(--spacing-md) var(--spacing-lg);
}

.confirm-content p {
    color: var(--text-gray-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.confirm-warning {
    color: #fbbf24;
    font-size: 0.875rem;
    margin-bottom: 0 !important;
}

.confirm-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    justify-content: flex-end;
}

.cancel-btn,
.confirm-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.cancel-btn {
    background: var(--bg-glass-light);
    color: var(--text-gray-light);
    border: 1px solid var(--border-glass);
}

.cancel-btn:hover {
    background: var(--bg-glass);
    color: var(--text-white);
}

.confirm-btn.primary {
    background: var(--primary-purple);
    color: var(--text-white);
}

.confirm-btn.primary:hover {
    background: var(--purple-dark);
}

.confirm-btn.danger {
    background: #ef4444;
    color: var(--text-white);
}

.confirm-btn.danger:hover {
    background: #dc2626;
}

/* 消息样式 */
.admin-message {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.admin-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 加载状态 */
.admin-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-gray-light);
    gap: var(--spacing-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-glass);
    border-top: 3px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.admin-error-text {
    text-align: center;
    color: var(--text-gray-light);
    padding: var(--spacing-xl);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .admin-container {
        padding: var(--spacing-lg);
    }

    .posts-table {
        font-size: 0.875rem;
    }

    .posts-table th,
    .posts-table td {
        padding: var(--spacing-sm);
    }

    .post-title-cell {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }

    .posts-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .posts-table-container {
        overflow-x: auto;
    }

    .posts-table {
        min-width: 600px;
    }

    .confirm-dialog {
        margin: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: var(--spacing-md);
    }

    .admin-title h1 {
        font-size: 1.75rem;
    }

    .posts-table {
        font-size: 0.75rem;
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
}